Skip to content

fix: validate duplicate language configurations in CHECKCFG#1376

Merged
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/checkcfg-duplicate-language-validation
Jul 13, 2026
Merged

fix: validate duplicate language configurations in CHECKCFG#1376
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/checkcfg-duplicate-language-validation

Conversation

@joaodinissf

@joaodinissf joaodinissf commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Adds an error-severity validation that flags duplicate language configurations in a CHECKCFG file.

The grammar accepts multiple for <Language> { ... } blocks in one configuration, with no defined semantics for how duplicates combine. CheckCfgValidator.checkConfiguredLanguageUnique now reports an error on each ConfiguredLanguageValidator that shares a language name with another, mirroring the existing catalog/check/parameter uniqueness validators and reusing the getDuplicates() helper. Covered by CheckCfgTest.testDuplicateLanguageNotOk.

Validation only, no quick-fix: a quick-fix would have to merge the duplicate blocks, which cannot preserve generated output. Language-level parameters are inherited by inner catalogs/checks and the generator resolves them first-wins per section, so collapsing two blocks into one silently changes which value inner catalogs inherit. The correct resolution depends on author intent, so the error guides the user to resolve duplicates manually.

Note: uniqueness of catalogs configured inside for <Language> blocks (checkConfiguredCatalogUnique only covers the legacy top-level catalog configurations) and of section-level parameters is a pre-existing validation gap, left as a follow-up.

Closes #103

🤖 Generated with Claude Code

@joaodinissf joaodinissf force-pushed the fix/checkcfg-duplicate-language-validation branch from 133312f to c89159f Compare May 30, 2026 10:58
@joaodinissf joaodinissf marked this pull request as draft May 30, 2026 17:14
@joaodinissf joaodinissf changed the title fix: validate and quick-fix duplicate languages in CHECKCFG (closes #103) fix: validate and quick-fix duplicate languages in CHECKCFG May 30, 2026
@joaodinissf joaodinissf marked this pull request as ready for review June 12, 2026 20:47
@joaodinissf joaodinissf force-pushed the fix/checkcfg-duplicate-language-validation branch from c89159f to 4bd5ca1 Compare June 12, 2026 20:47
@joaodinissf joaodinissf requested a review from rubenporras June 12, 2026 20:47
@joaodinissf joaodinissf enabled auto-merge (rebase) June 12, 2026 20:47
@joaodinissf joaodinissf marked this pull request as draft June 12, 2026 21:07
auto-merge was automatically disabled June 12, 2026 21:07

Pull request was converted to draft

@joaodinissf joaodinissf removed the request for review from rubenporras June 12, 2026 21:07
@joaodinissf joaodinissf force-pushed the fix/checkcfg-duplicate-language-validation branch 2 times, most recently from fdcf350 to 01559a7 Compare June 14, 2026 09:36
@joaodinissf joaodinissf changed the title fix: validate and quick-fix duplicate languages in CHECKCFG fix: validate duplicate language configurations in CHECKCFG Jun 14, 2026
@joaodinissf joaodinissf force-pushed the fix/checkcfg-duplicate-language-validation branch from 7133f27 to d9d4b7f Compare July 7, 2026 15:53
The CHECKCFG grammar accepts multiple `for <Language> { ... }` blocks for
the same language in one configuration, with no defined semantics for how
duplicates combine. CheckCfgValidator.checkConfiguredLanguageUnique now
reports an error on each ConfiguredLanguageValidator that shares a
language name with another, mirroring the existing catalog/check/parameter
uniqueness validators and reusing the getDuplicates() helper. Covered by
CheckCfgTest.testDuplicateLanguageNotOk.

Validation only, no quick-fix: a merge quick-fix cannot preserve generated
output. Language-level parameters are inherited by inner catalogs and
checks, and the properties generator resolves them first-wins per section,
so collapsing two blocks into one silently changes which value inner
catalogs inherit. The correct resolution depends on author intent, so the
error guides the user to resolve duplicates manually.

Language-scoped catalog/check/parameter uniqueness inside a single
language block is a pre-existing validation gap left as a follow-up.

Closes dsldevkit#103

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ANGM7L3BaEGfGUmPVKRt4
@joaodinissf joaodinissf force-pushed the fix/checkcfg-duplicate-language-validation branch from d9d4b7f to 662b6ee Compare July 11, 2026 14:23
@joaodinissf joaodinissf marked this pull request as ready for review July 11, 2026 14:38
@joaodinissf joaodinissf requested a review from rubenporras July 11, 2026 14:38
@joaodinissf joaodinissf merged commit ecab41e into dsldevkit:master Jul 13, 2026
4 checks passed
@joaodinissf joaodinissf deleted the fix/checkcfg-duplicate-language-validation branch July 13, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CHECKCFG allows duplicate languages

2 participants